create Database QLDauGia

create table Account
(
MaKH int Identity,
Username varchar(50),
Passw varchar(20),
primary key (Username)
)
 drop table Info_Customer
create table Info_Customer
(
MaKH int Identity,
Name nvarchar(50),
Sex nvarchar(5),
CMND bigint, 
nAddress nvarchar(50),
City nvarchar(20), 
Email varchar(50), 
phone bigint
primary key (MaKH)
)

create table Info_Payment
(
MaKH int Identity,
AccountCode bigint,
nmoney money
primary key (MaKH) 
)
--Store proc
drop proc Add_Info_Customer
create proc Add_Info_Customer (@Name nvarchar(50),
 @Sex nvarchar(4), @CMND bigint, @Address nvarchar(100), @City nvarchar(20), @Email varchar(50), @Phone bigint)
as
Begin
	Insert into Info_Customer(Name,Sex,CMND,nAddress, City, Email, phone)values(@Name,@Sex,@CMND,@Address,@City,@Email,@Phone)
End
go

create proc Add_Account (@Username varchar(20),@Pass varchar (15))
as
begin
	Insert into Account(Username,Passw)values(@Username,@Pass)
end
go

create proc Add_Info_Payment (@AccountCode bigint,@nmoney bigint)
as
begin
	Insert into Info_Payment(AccountCode,nmoney)values(@AccountCode,@nmoney)
end
go
